<template>
     <van-nav-bar
    title="个人中心"
    left-text="返回"
    left-arrow
    @click-left="onClickLeft"
  />
  <div class="base-info">
    <img :src="pic" alt="" />
    <p>旺财</p>
  </div>
  <van-cell-group>
    <van-cell title="我的收藏" is-link url="#/store" />
    <van-cell title="退出登录" />
  </van-cell-group>
</template>

<script>
import { useStore } from 'vuex';
import timg from "@/assets/images/timg.jpg"
import { computed } from '@vue/runtime-core';
export default {
  setup(){ 
    let store = useStore()
    let pic =computed(()=>{
      let {info} = store.state
      return info ? info.pic : timg
    })
    const onClickLeft = () => history.back();
    return{ 
      onClickLeft,
      pic
    }
  }
}
</script>

<style lang="less" scoped>
.base-info {
  box-sizing: border-box;
  margin: 20px 0;

  img {
    display: block;
    margin: 0 auto;
    width: 86px;
    height: 86px;
    border-radius: 50%;
  }

  p {
    line-height: 50px;
    font-size: 18px;
    text-align: center;
  }
}
/deep/ .van-icon,
/deep/ .van-nav-bar__text {
  color: #000;
}
</style>